# -*- coding: utf8 -*-

import os

import jinja2


def format_percent(value):
    return ('%.1f' % value) + u'%'


def format_time_sec(value):
    return ('%.1f' % value) + u' сек'


ENVIRONMENT = jinja2.Environment(
    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
    extensions=['jinja2.ext.autoescape'])

ENVIRONMENT.filters['percent'] = format_percent
ENVIRONMENT.filters['time_sec'] = format_time_sec
